<template>
  <div>

    <div class="header-bg">
      <div class="goback" @click="goback()" v-show="flag">
        <i class="iconfont iconfanhui1"></i>
      </div>
      <div class="header-box">
        <div class="cir left">
          <span></span>
          <span></span>
        </div>
        <h1>
          {{name}}
        </h1>
        <div class="cir right">
          <span></span>
          <span></span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        flag: false,  
      }
    },
    methods: {
      goback() {
        this.$router.go(-1)
      }
    },
    props:['name'],
    watch: {
      "$route.path": function (newVal) {
        if (newVal === "/home") {
          this.flag = false
        } else {
          this.flag = true
        }
      }
    }
  }

</script>
<style lang="scss">

</style>
